-- card: 16845 from stack: in -- bmap block id: 17138 -- flags: 0000 -- background id: 12278 -- name: trapadr -- part 1 (button) -- low flags: 00 -- high flags: A003 -- rect: left=14 top=282 right=304 bottom=114 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Trap Address ----- HyperTalk script ----- on mouseUp put card field "word" into temp put trapadr(temp) into theaddr put char 3 to 8 of theaddr into theaddr repeat if first char of theaddr is not "0" then exit repeat delete first char of theaddr end repeat put theaddr into card field "address" end mouseUp -- part 2 (field) -- low flags: 00 -- high flags: 2004 -- rect: left=121 top=282 right=305 bottom=218 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: word ----- HyperTalk script ----- on returninfield click at loc of card button "Trap Address" end returninfield on enterinfield end enterinfield -- part 3 (field) -- low flags: 01 -- high flags: 2004 -- rect: left=225 top=282 right=305 bottom=323 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: address -- part contents for background part 68 ----- text ----- TrapAdr is an XFCN that takes the trap word of a given toolbox trap and returns the address of the trap in memory. It uses the toolbox NGetTrapAddress to perform its action. Note that this XFCN expects the entire trap word of the trap and not just the trap number. For example, the trap word for GetNextEvent is A970 while the trap number is 170. Read about the trap mechanism in Inside Macintosh for more details. Try the Demo below to clarify any uncertainties you may have about this XFCN. -- part contents for card part 2 ----- text ----- A066 -- part contents for card part 3 ----- text ----- 41013A